import Vue from 'vue'
import VueRouter from 'vue-router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Mint from 'mint-ui';
import 'mint-ui/lib/style.css';
import '../../assets/less/base.less'


import Index from './index.vue'
import rechargeList from './views/rechargeList.vue'


import * as filters from './filters/index.js'

Vue.use(VueRouter);
Vue.use(VueAxios, axios);
Vue.use(Mint);

axios.defaults.baseURL = 'http://wyds.new.91wangjing.com/';
// axios.defaults.baseURL = 'http://172.16.10.71:8285/';
// axios.defaults.baseURL = 'http://3s.dkys.org:28063/';
Vue.config.productionTip = false;

if (window.AndroidWebView) {
    axios.defaults.headers.token = window.AndroidWebView.getToken();
} else {
    axios.defaults.headers.token = localStorage.getItem('token');
}

// 注册全局的过滤器
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})

const routes = [
    { path: '/rechargeList', component: rechargeList },
    { path: '*', redirect: '/rechargeList' }

]

const router = new VueRouter({
    routes
});

var app = new Vue({
    el: '#app',
    router,
    render: h => h(Index)
})